package com.example.myanimator.svg;

import android.graphics.drawable.Animatable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;

import com.example.myanimator.R;

public class SevenActivity extends AppCompatActivity {

    private ImageView ivSvg;
    private TextView tv_3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_seven);
        ivSvg = findViewById(R.id.iv_svg);
        AnimatedVectorDrawableCompat animatedVectorDrawableCompat =AnimatedVectorDrawableCompat.create(SevenActivity.this,R.drawable.svg_line_bar_animtor);
        ivSvg.setImageDrawable(animatedVectorDrawableCompat);

        findViewById(R.id.bt_start).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ((Animatable)ivSvg.getDrawable()).start();

            }
        });
    }
}